﻿CREATE PROCEDURE [dbo].[Smarly_Common_SetValue]
	@name NVARCHAR(64),
	@value NVARCHAR(MAX)
AS
BEGIN
	IF EXISTS(SELECT *
						FROM [dbo].[smarly_Common]
						WHERE [Name] = @name)
	BEGIN
		UPDATE [dbo].[smarly_Common]
			 SET [Value] = @value
		 WHERE [Name] = @name
	END
	ELSE
	BEGIN
		INSERT INTO [dbo].[smarly_Common]
							 ([Name]
							 ,[Value]
							 ,[Description])
				 VALUES
							 (@name
							 ,@value
							 ,NULL)
	END
END
